﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

public partial class Comadminister : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (null == Session["com"])
        {
            Label3.Text = "<script>alert('请登录！');window.location.href='ComDefault.aspx';</script>";

        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        //上传图片
        FileUpload FU = (FileUpload)FormView1.FindControl("FU");
        string path = FU.FileName;
        string[] file = path.Split('\\');
        string filename = file[file.Length - 1];
        string path1 = Server.MapPath("");
        string ok = path1 + "\\images\\comlogo\\" + filename;
        FU.SaveAs(ok);
        Image igGoods = (Image)FormView1.FindControl("Image1");
        igGoods.ImageUrl = "~/images/comlogo/" + filename;
        TextBox tx = (TextBox)FormView1.FindControl("txtcomlogo");
        tx.Text = filename;
    }
}
